import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router"
import SubWinLayout from "@renderer/components/SubWinLayout.vue"
import Setting from "@renderer/components/Setting.vue"
import Home from "@renderer/components/Home.vue"
import Info from "@renderer/components/Info.vue"

const routes:RouteRecordRaw[] = [
  {
    //设置缺省值，页面打开自动显示
    path: '/',
    redirect: '/home'//重定向
  },{
    path: "/home",
    name: "home",
    component: Home
  },{
    path: "/sub-win",
    name: "sub-win",
    component: SubWinLayout,
    children: [
      {
        path: "setting",
        name: "setting",
        component: Setting
      }, {
        path: "info",
        name: "info",
        component: Info
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
